<!doctype html>
<html>

<head>
    <meta charset="utf-8">
    <title>{$notice.title}-{$siteconfig.site_name}</title>
    <meta name="keywords" content="{$siteconfig.site_keywords}" />
    <meta name="description" content="{$siteconfig.site_description}" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link rel="shortcut icon" href="__TEMPLATE1_IMAGES__/bellbell.ico" type="image/x-icon" />
    <link rel="icon" href="__TEMPLATE1_IMAGES__/bellbell.png" type=" image/png">
    <link href="__TEMPLATE1_CSS__/base.css" rel="stylesheet">
    <link href="__TEMPLATE1_CSS__/m.css" rel="stylesheet">
    <script src="__TEMPLATE1_JS__/jquery-1.8.3.min.js"></script>
    <script src="__TEMPLATE1_JS__/comm.js"></script>
    <!--[if lt IE 9]>
    <script src="__TEMPLATE1_JS__/modernizr.js"></script>
    <![endif]-->

</head>

<body>
    <!--top begin-->
    {include file="public/header" /}

    {include file="public/searchbox" /}
    <!--top end-->
    <article>
        <!--lbox begin-->
        <div class="lbox">
            <div class="content_box whitebg">
                <h2 class="htitle"><span class="con_nav">您现在的位置是：<a href="/">网站首页</a>><a
                            href="#">网站公告</a></span>网站公告</h2>
                <h1 class="con_tilte">{$notice.title}</h1>
                <p class="bloginfo"><i class="avatar"><img
                            src="__TEMPLATE1_IMAGES__/avatar.jpg"></i><span>铃铛铃铛</span><span>{$notice.create_time|date="Y-m-d"}</span></p>
              
                <div class="con_text">
                    
                        {$notice.content|raw|htmlspecialchars_decode}
                    
                    <p class="share">
                        <b>转载：</b>感谢您对铃铛铃铛个人博客网站平台的认可，以及对我们原创作品以及文章的青睐，非常欢迎各位朋友分享到个人站长或者朋友圈，但转载请说明文章出处“来源铃铛铃铛个人博客”。</p>
                    <p><span class="diggit">很赞哦！ (74)</span></p>
                    <div class="nextinfo">
                        <p>上一篇：
                            {if $pre}
                            <a href="/index/notice/detail/id/{$pre.id}">{$pre.title}</a>
                            {else /}
                            没有了
                            {/if}
                        </p>
                        <p>下一篇：
                            {if $next}
                            <a href="/index/notice/detail/id/{$next.id}">{$next.title}</a>
                            {else /}
                            没有了
                            {/if}
                        </p>
                    </div>
                </div>
            </div>

           
        </div>
        <!--lbox end-->
        <div class="rbox">
            <div class="whitebg paihang">
                <h2 class="htitle">点击排行</h2>
                <!-- <section class="topnews imgscale"><a href="info.html"><img
                            src="__TEMPLATE1_IMAGES__/h1.jpg"><span>6条网页设计配色原则,让你秒变配色高手</span></a></section> -->
                <ul>
                    {volist name="rank" id="vo"}
                    <li><i></i><a href="/index/news/detail/id/{$vo.id}">{$vo.title}</a></li>
                    {/volist}
                    
                </ul>
            </div>
            
         
           
        </div>
    </article>
    {include file="public/footer" /}
</body>

</html>

<script>
    $(function(){
        // 点击刷新验证码
        var verifyUrl = $('#verify-img').attr('src');
            $('#verify-img').click(function(){
                $(this).attr('src', verifyUrl );
            });

        // 异步提交评论内容
        $('#comment_btn').click(function(){
            
            var content = $('#comment_content').val();
            var nid = $('#nid').val();
            var verify = $('#verify').val();
            var userid = "{:session('uid')}";

            if(!userid){
                alert('您还没有登录');
                return false;
            }

            if(!content){
                alert('请填写评论内容');
                return false;
            }
            if(!verify){
                alert('请填写验证码');
                return false;
            }
            $('#comment_btn').attr("disabled", true);
            $.ajax({
                url : "/index/news/comment",
                type : "post",
                data : {content: content, nid: nid, verify: verify},
                success : function(response, status, xhr){
                    console.log(response);
                    if(response.status == 200){
                        alert("发布成功，等待审核");
                        window.location.reload();
                      
                    }else if(response.status == 400){
                        alert(response.msg);
                        $('#comment_btn').removeAttr("disabled");
                    }
                },
                error : function(xhr, errorText, errorStatus){
                    console.log(xhr.status + ':' + xhr.statusText);
                    $('#comment_btn').removeAttr("disabled");
                }
            });
        });
    });

</script>